home *** CD-ROM | disk | FTP | other *** search
- * Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
- * The C++ Answer Book */
- * Tony Hansen */
- * All rights reserved. */
- include <process.h>
- include <debug.h> /* DELETE */
- / Remove this process from a given list.
- / Return 0 if not found on the list.
- nt process::rmfromlist(process *srchprocess, process **stacklist)
-
- if (debug) { /*DELETE*/
- cerr << "process" << this << "::rmfromlist(" << srchprocess;/*DELETE*/
- if (stacklist == &t_runprocesses) /*DELETE*/
- { cerr << ", runprocesses)\n"; } /*DELETE*/
- else if (stacklist == &t_waitprocesses) /*DELETE*/
- { cerr << ", waitprocesses)\n"; } /*DELETE*/
- else if (stacklist == &t_doneprocesses) /*DELETE*/
- { cerr << ", doneprocesses)\n"; } /*DELETE*/
- else /*DELETE*/
- { cerr << ", unknown-list)\n"; } /*DELETE*/
- } /*DELETE*/
- // search the list
- for (process **pp = stacklist; *pp; pp = &(*pp)->t_next)
- if (*pp == srchprocess)
- {
- process *sv = *pp;
- *pp = sv->t_next;
- sv->t_next = 0;
- if (debug) /*DELETE*/ cerr << "<<<< process" << this << "::rmfromlist(" << srchprocess << ") <- 1\n";
- return 1;
- }
-
- if (debug) /*DELETE*/ cerr << "<<<< process" << this << "::rmfromlist(" << srchprocess << ") <- 0\n";
- return 0;
-
-